package com.xyazm.coupon.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xyazm.common.dao.BaseDAO;
import com.xyazm.coupon.entity.CouponResourceDO;
import com.xyazm.coupon.mapper.CouponResourceMapper;
import org.springframework.stereotype.Repository;

/**
 * 优惠券资源DAO组件
 *
 * @author zhonghuashishan
 */
@Repository
public class CouponResourceDAO extends BaseDAO<CouponResourceMapper, CouponResourceDO> {

    /**
     * 优惠券资源信息
     * @param couponResourceId
     * @return
     */
    public CouponResourceDO getCouponResource(String couponResourceId) {
        QueryWrapper<CouponResourceDO> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("coupon_resource_id", couponResourceId);
        return getOne(queryWrapper);
    }

}
